<?php 
/*************************************************************************************
 * index.php
 * -----------
 * phpGMapTrips 
 * 
 * This php application allows you to easily record your travel destinations 
 * and display them with Google maps.
 * 
 * Author: Stephane Coste (lescoste@gmail.com)
 * Copyright: (c) 2006 Stephane Coste (http://lescoste.net/)
 * Release Version: 0.1
 * CVS Revision Version: $Revision: 1.35 $
 * Date Started: 2006/02/19
 * Last Modified: $Date: 2007/03/17 08:41:59 $
 *
 *************************************************************************************
 *
 *     This file is part of phpGMapTrips.
 *
 *   phpGMapTrips is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   phpGMapTrips is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with phpGMapTrips; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ************************************************************************************/
?>
<?php include_once("config.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<style type="text/css"> v\:* { behavior:url(#default#VML); } </style>
<?php include_once("langjs.php"); ?>
<title><?php echo $title; ?></title>
<link rel="icon" href="images/favicon.gif" type="image/gif" />
<link rel="stylesheet" href="gearth.css" type="text/css" media="screen" />
<script src="http://maps.google.com/maps?file=api&v=2.x&key=<?php echo $gmapKey; ?>" type="text/javascript"></script>
<script type="text/javascript" src="ajaxCaller.js"></script>
<script src="labeltrick.js" type="text/javascript"></script>
<script src="menu.js" type="text/javascript"></script>
<script src="common.js" type="text/javascript"></script>
<script src="mappoints.js" type="text/javascript"></script>
<script type="text/javascript" src="statemanager.js"></script>
<script type="text/javascript" src="stateusage.js"></script>
<?php if ($yahooKey != "") { ?>
<script src="yahoomap.js" type="text/javascript"></script>
<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=<?php echo $yahooKey; ?>"></script>
<?php } ?>
<script type="text/javascript">
function loadMaps() {
displayInitialMapDivs();
showMap(2);showMapzoom(10);
<?php 
// load trips list
$showfile = urldecode($_GET["showfile"]); 
$showtrip = urldecode($_GET["showtrip"]); 
$showpoint = urldecode($_GET["showpoint"]); 
echo "defaultFile = '".$showfile."';";
echo "default_trip = '".$default_trip."';";
echo "showpoint = '".$showpoint."';";
?>
callTrips("<?php echo $showfile; ?>", "<?php echo $showtrip; ?>", "<?php echo $showpoint; ?>");
GEvent.addListener(map, 'click', function(overlay, point) {
  if(overlay){
showClickedPoint(overlay.my_name, false);
}else if(point){addPoint(point);}
});
GEvent.addListener(mapzoom, 'click', function(overlay, point) {
  if (overlay) {
	  showClickedPoint(overlay.my_name,false);
	  setCurrentPoint(overlay);
  } else if (point) {
	  addPoint(point);
  }
});
labelTrick();
}
</script>
</head><body onload="loadMaps()" onunload="GUnload()">
<?php // Maps display area ?>
<div id="maps"><div id="mapcontainer"><div id="map"></div></div><div id="mapzoom"></div><div id="mapyahoo"></div></div>
<?php // Tools display area ?>
<div id="toolsZone" >
	<div id="menutripscontainer" >
	<div class="menuBar">
	<a href='javascript:void(0);' class='menuButton' title='<?php echo $lang_reload_trips_link; ?>' onmouseover="buttonMouseover(event, 'menu');" ><?php echo $lang_trips_title; ?></a><div id="menu" class="menu" onmouseover="menuMouseover(event)">
</div><a href='javascript:void(0);' id='l_places' class='menuButton' title='<?php echo $lang_places_title; ?>' onmouseover="buttonMouseover(event, 'menu_places');" ><?php echo $lang_places_title; ?></a><div id="menu_places" class="menu" onmouseover="menuMouseover(event)">
</div><a href='javascript:void(0);' id='l_search' class='menuButton' title='<?php echo $lang_tools_label; ?>' onmouseover="buttonMouseover(event, 'menu_tools');" ><?php echo $lang_tools_label; ?></a><div id="menu_tools" class="menu" onmouseover="menuMouseover(event)">
		<a href="manageIndex.php?langue=<?php echo $langue; ?>" class="menuItem" target="phpGMapTripsAdminPage" title="<?php echo $lang_admin_trips_link; ?>" ><img src="images/admin.gif" alt="<?php echo $lang_admin_trips_link; ?>" /> <?php echo $lang_admin_trips_link; ?></a>
  		<a href='javascript:void(0);' class='menuItem' onclick='toggleMapPolyline();' title='<?php echo $lang_polyline_link; ?>' ><img src='images/polyline.gif' alt='<?php echo $lang_polyline_link; ?>' /> <?php echo $lang_polyline_link; ?></a>
  		<a href='javascript:void(0);' class='menuItem' onclick='showGoogleMap();' title='Google' ><img src='images/google.png' alt='google' /> Google Maps</a>
<?php if ($yahooKey != "") { ?>
  		<a href='javascript:void(0);' class='menuItem' onclick='showYahooMap();' title='Yahoo' ><img src='images/yahoo.png' alt='yahoo' /> Yahoo Maps</a>
		<?php } ?>
		<hr/>
		<form name="searchbox" method="get" style="display:inline;" onsubmit="if(this.st[0].checked){searchPoint(this.search.value);}else{showAddress(this.search.value);};return false;" >
		<label for="search"  class="inside"><?php echo $lang_search_label; ?></label>
		<input type="search" name="search" id="search" Value="" size="20" results="5" />
		<br/>
		<input type="radio" name="st" value="p" CHECKED /> <?php echo $lang_places_label; ?>
		<br/>
		<input type="radio" name="st" value="g" /> <?php echo $lang_newaddress_label; ?>
		<hr/>
		<input type="checkbox" name="visitor" value="visitor" onClick="showVisitor(this.checked);" /> <?php echo $lang_show_visitor_link; ?>
		</form>
		<hr/>
		<?php
		foreach ($auth_langues as $lang => $language) {
			$flagstyle ="";
			if ($lang == $langue) { $flagstyle = ' style="border:1px outset black;"';}
			echo '<a href="?langue='.$lang.'" class="menuItem" title="'.$language.'"><img src="./images/'.$lang.'.gif" '.$flagstyle.' /> '.$lang.'</a> ';
		} ?>
		</div><a href='javascript:void(0);' id='l_about' class='menuButton' title='<?php echo $lang_about; ?>' onmouseover="buttonMouseover(event, 'menu_about');" ><?php echo $lang_about; ?></a><div id="menu_about" class="menu" onmouseover="menuMouseover(event)"><a href="http://fusion.google.com/add?moduleurl=http%3A//lescoste.homeip.net/lescoste/gearth/ggadget.php%3Fshowfile%3D<?php echo $showfile; ?>"><img src="http://buttons.googlesyndication.com/fusion/add.gif" width="104" height="17" border="0" alt="Add to Google"></a><br/>
		<?php printFooter(); ?>
	</div>
<div id="loadingimg" style="display:none;" ><img src="images/loading.gif"/></div>
	</div>
	</div>
</div>

<div id="horizon">
<iframe id="edittripiframe" name="edittripiframename" class="drag" ></iframe>
</div>

</body>
</html>